import React, {Component} from 'react';
import style from '../../css/movieItem.scss'

class MovieItem extends Component {
  constructor(props){
    super(props)
    this.state = {}
  }
  
  render() {
    return (
      <div className={style.box} onClick={this.goMovieDetail}>
        {/*<img src="/src/images/9.jpg" alt="电影图片"/>*/}
        <img src={this.props.images.small} alt="电影图片"/>
        <h4>电影名称：{this.props.title}</h4>
        <h4>上映年份：{this.props.year}</h4>
        <h4>电影类型：{this.props.genres.join('、')}</h4>
      </div>
    );
  }
  
  goMovieDetail = () => {
    this.props.history.push('/movie/detail/'+this.props.id)
  }
}

export default MovieItem;
